import 'package:flutter/material.dart';

const int MainWalletPageIndex = 0;
const int MainMyPageIndex = 1;

void scrollToPosition(ScrollController controller,
    {int direction = 0}) {
  if (direction == -1) {
    return;
  }
  Future.delayed(Duration(milliseconds: 50), () {
    if (controller.hasClients) {
      if (direction == 0) {
        controller.jumpTo(controller.position.minScrollExtent);
      } else {
        controller.animateTo(controller.position.maxScrollExtent,
            duration: Duration(milliseconds: 200), curve: Curves.linear);
      }
    }
  });
}